Cesium Widget Example KML

If the installation of Cesiumjs is ok, it should be reachable here: http://localhost:8888/nbextensions/CesiumWidget/cesium/index.html


In [15]:
from CesiumWidget import CesiumWidget
from IPython import display
import numpy as np

Create widget object


In [16]:
cesium = CesiumWidget()

Display the widget:


In [17]:
cesium

Cesium is packed with example data. Let's look at some GDP per captia data from 2008.


In [18]:
cesium.kml_url = '/nbextensions/CesiumWidget/cesium/Apps/SampleData/kml/gdpPerCapita2008.kmz'

Example zoomto


In [19]:
for lon in np.arange(0, 360, 0.5):
    cesium.zoom_to(lon, 0, 36000000, 0 ,-90, 0)

In [20]:
cesium._zoomto


Out[20]:
[359.5, 0.0, 36000000.0, 0.0, -90.0, 0.0]

Example flyto


In [21]:
cesium.fly_to(14, 90, 20000001)

In [8]:
cesium._flyto


Out[8]:
[14.0, 90.0, 20000001.0, 0.0, -90.0, 0.0]